/********************************************************************************
Name:  PreferredAccountEmail
Copyright © 2012  HFH International
======================================================
======================================================
Purpose:
-------
To make only two active Account Email as preferred (one web email and one email)
======================================================
======================================================
History 
-------
VERSION  AUTHOR                DATE        DETAIL              
  1.0  - CG DEV TEAM    7/10/2012   INITIAL DEVELOPMENT  
*********************************************************************************/ 
trigger PreferredAccountEmail on Account_Email__c(before insert,before update,before delete) {

AccountEmailTriggerHandler triggerhandler=new AccountEmailTriggerHandler();   
    if(trigger.isInsert && trigger.isbefore){
       
        triggerhandler.AccountEmailInsert(trigger.new);
      }
    if((trigger.isUpdate && trigger.isBefore)){
       
        triggerhandler.AccountEmailUpdate(trigger.new, trigger.old);
      }  
      
      if(trigger.isbefore && trigger.Isdelete){
         
          triggerhandler.ContactEmailDelete(trigger.old);
      }
}